home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / TTFHDX / ST.C < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-09  |  959 b   |  62 lines

  1. /* st.c */
  2.  
  3. /*
  4.  * ST specific code
  5.  * and error handling.
  6.  *
  7.  */
  8. #include <gemdefs.h>
  9. #include "define.h"
  10. #include "part.h"
  11.  
  12. extern char sbuf[];
  13.  
  14.  
  15. /*
  16.  * Stupid delay between writes (.01 second);
  17.  * called in supervisor mode on the ST.
  18.  *
  19.  * The hard disk controller cannot keep up with
  20.  * full-tilt accesses for some reason.
  21.  *
  22.  */
  23. delay()
  24. {
  25.     register long hz200v, *p;
  26.  
  27.     p = (long *)0x4ba;
  28.     hz200v = *p + 2L;        /* compute future value */
  29.     while (*p < hz200v)        /* wait for it to reach that */
  30.     ;
  31. }
  32.  
  33.  
  34. /*
  35.  * Throw up an alert box
  36.  * with the given text.
  37.  *
  38.  */
  39. err(s)
  40. char *s;
  41. {
  42.     graf_mouse(ARROW, 0L);
  43.     form_alert(1, s);
  44.     return ERROR;
  45.     graf_mouse(HOURGLASS, 0L);
  46. }
  47.  
  48.  
  49. /*
  50.  * Error, concatenate the three strings
  51.  * and throw up an alert box.
  52.  *
  53.  */
  54. errs(s1, s2, s3)
  55. char *s1, *s2, *s3;
  56. {
  57.     strcpy(sbuf, s1);
  58.     strcat(sbuf, s2);
  59.     strcat(sbuf, s3);
  60.     return err(sbuf);
  61. }
  62.